<?php
$process = new swoole_process('callback_function', true); 
echo date("Y-m-d H:i:s"),PHP_EOL;
$pid = $process->start(); 
  
function callback_function(swoole_process $worker) 
{ 
    
    while($input = $worker->read()){
      sleep(1);
      echo $input;
      if($input == "Quit\n"){
        break;
      }
    }
    //$worker->exec('/usr/bin/php', array(__DIR__."/input.php")); 
} 
echo date("Y-m-d H:i:s");

$c = 0;
while($c < 3){
  $c ++;
  $process->write("hello world\n");
  echo $pid." => ",PHP_EOL;
  echo $process->read();
  echo PHP_EOL;
}
$process->write("Quit\n");

$ret = swoole_process::wait();
var_dump($ret);